Fix #314, #324