Fix build errors and add a test