Merged changes; fixed build errors