#5 extended tests, fixed some discovered bugs