Fixed some problems and bugs, hopefully now everything works