Check input
Make the code work on iOS6 (except database_builder.js)