Refactoring introduced some small bugs that are fixed now