Removed unused code. Added negative tests.