Fixed compile errors but it still doesn't work.