Fixed a bug which caused crashing in older Android APIs.