Fixes for phonegap