small consmetic fix
wrong type cast
put spaces after if/while