Updated source and tests