Fixed issue with incorrect class being instantiated