Added assertion checks