More RayTracer fixes and support. Fix init and destroy of member variables. Validate arguments and casting.