Fixing development environment for localhost

Fixed a bug in the localhost detection causing the script to die prematurely