Fixes for issues #1, #2, handle mobile envs