Bugfixes

If you think this isn't needed I would just take it out?