Implemented getLastRecord and put more details in error messages