#142 - fixed null error and added test