fixes #1461
fixed tests and removed unnecessary code