Many bugfixes, orientation assignment should be OK