merge Pantelis Antoniou's build fixes

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>