Fixing setup procedure

Modifying the setup procedure a bit. See each commit for more details.