Adding some fixes done by @davedevelopment according to issue #11 of base repository