A few bugfixes

-SMP Compatible