Test script

1 bugfix and additional test script.
FIXME might or might not be effective, not sure