Added Tobias' fixes