Added captures; minor bugfixes