Fixed errors in hand assembled code