Tests added by nlaz and jiuling