[NGRINDER-486] Fix bugs
[NGRINDER-486] Clean up code