Magic margin scaling. Closes #80.