Bug fixes for Horn-Schunck

Fixed bugs for index errors