Fixed a few errors - test works