Added assertion framework to aid type checking.