Fix some use after free
Allow margins up to 10000 in obconf (Bug 3601)
Return values from functions that have a return type (Bug 5872)