Fix for runtime errors