Fixed warnings and exception catching for gadgethdf units