Fixed null pointer bugs and illegal number format conversions