2427 Adds check for length of lastPage array instead of undefined or empty string

fix whitespaces

fix typos

add myself to list of people who help