minor bugfixes, useless check removed