Fixed backwards compatibility and added test