Miles bug-fixes