Closes #653

Fix tests