Added missed return statements + corrected invalid array key