Added availability set and fixed issues.

1. Fixed #17
2. Fixed #20
3. Fixed #15