Additions and bugfixes