Add exceptions checking tests
Change exception messages
Add loop optional argument
PEP8
merge pin attributes update