Tweaking previous pull request

Minor bug fixes, tweaks and performance improvements.
Updating specs