Fixes some small bugs