Multiple compilation fixes, wrong working branch was submitted.