Fix some things (thanks CastagnaIT)