Implemented BST. Fixed argument checks in all factory classes.