Several bugs fixed.
Checks if internet is available.