Fix #139 (Return error on invalid chmod).