Fixed some build errors

Note: There are still warnings due to functions which have not been
written yet.