bugfixes from Trowel