Bugfixes and updated defines