Fixes some Bugs