Reverted null frame changes, cleaned up code