Tests and small changes