Merged from 2 projects - probably broke some functionality :(