fix a few types and stuff -- thanks Lukas