Fixed code causing warnings in Unity.