Fixed remarks in if/fi to add echo as empty if/fi caused script fail.
Added missing then at line 46