[#437] fixed local install

failed if the platform was already added
failed due to 'this' loosing scope

technically separate issues from #437, but these are one line fixes