Added example tests and small fixes