Added trim shim function. Closes #45