Minor modifications and bugfixes