Base64, python script and airplane mode errors fixed.

Some erros with Base64 and with the python script were fixed. The airplane mode is changed if the user has API lower than v16.