Fix several issues with footprints. Fixes #631
Merge remote-tracking branch 'origin/master'