compilation and references fixes