Fixing some issues that Jesper pointed out