Applied fixes as suggested in http://www.pimcore.org/board/viewtopic.php?f=15&t=256