Fixed issues due to new API changes.