Fix build and references