Fixes some code quality issues