Fix idiotic mistakes, fix type signatures