Improvements and bugfixes (#19, #22, #35, #34, #29, #28)