Fixes minor bugs, naming and return types