Cleaned up, got rid of testcases and unnecessary type checks.