Fix compact function for Windows #21