Fix #67 and fix compiler warnings.