Fixed the code for the iPad

Fixed iPad row-deslection, iPad and iPhone bugs such as crashing when
the notes application has 0 notes. Fixed incorrect note selection on
iPad.