Fix bug #58, remove some uneeded code