bugfixes... too many to write here