fix #130 Add better handling for units