Fix segfault by invalid margin value
Merge branch 'livibetter-master'