Fixed major bug with setup functions