Added input arguments checking to AClass. Tests for AClass are added.
Make changes to use new class patterns.