Fixing minor issues with refactored code that i hadent tried out yet.