Fixes some code errors