Replaced unit test suite. Adjusted all tests and removed some of them which were quite pointless. Updated comments.
Added cast which suppresses some compiler warning.