Clean up code a bit

Little errors and shortcomings