bugfix + deleted unused code

Signed-off-by: Wouter Vroege <wouter@woutervroege.nl>