Fixed errors and todo stuff