if the rear shifting shifts properly and accurately on one side of the cassette
and is out of adjustment on the other side of the cassette
the culprit is likely a bent derailleur hanger
bike shops have a tool to check hanger alignment
which has to be pretty close to perfect for indexed shifting to work properly
as for the chain falling off the smallest cog
the first thing you should do when setting up shifting
is set the H and L limit screws without the cable attached
to make sure the derailleur can not push the chain too far one way or the other