Fixes some errors